//
//  ViewController.m
//  YMPhotograph
//
//  Created by 玥明 许 on 16/7/1.
//  Copyright © 2016年 xym. All rights reserved.
//

#import "ViewController.h"
#import <AVOSCloud/AVOSCloud.h>
#import "AddPhotoViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *userNameField;
@property (weak, nonatomic) IBOutlet UITextField *passwordField;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)loginClick:(id)sender {
    [AVUser logInWithUsernameInBackground:self.userNameField.text password:self.passwordField.text block:^(AVUser *user, NSError *error) {
        UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        AddPhotoViewController *controller = [story instantiateViewControllerWithIdentifier:@"AddPhotoViewController"];
        [self.navigationController pushViewController:controller animated:YES];
    }];
}
@end
